/*********************************************************
This inputs data from the Prolific Survey we ran in April 2023

Created Apr 2023
Author Laura Gee


Updated May 30 2025
*********************************************************/
clear all


//-----------import de-identified data 
use "$data/3_decision_makers/DM_survey_deid.dta", clear

//-------------------Interacts with Parents
count if InteractWithParents=="Yes" //377 interact with parents

//In your role as a person who interacts with parents, which parent do you usually contact first (if contacting only 1 parent) with this type of household? 
gen ContactMomFirst=.
	replace ContactMomFirst=1 if BinaryContactMomvDad=="Mother"
	replace ContactMomFirst=0 if BinaryContactMomvDad=="Father"

destring ContactMom1stProp_F1_4, force replace
destring ContactDad1stProp_M1_4, force replace

//What proportion of the time do you contact the mother first if only contacting 1 parent first?
//OR
//What proportion of the time do you contact the father first if only contacting one parent first?
// randomized by DadListedFirst
gen ContactMomFirstPct=.
	replace ContactMomFirstPct=ContactMom1stProp_F1_4 if ContactMom1stProp_F1_4!=.
	replace ContactMomFirstPct=100-ContactDad1stProp_M1_4 if ContactDad1stProp_M1_4!=.
	replace ContactMomFirstPct=ContactMomFirstPct/100
	
/*Main New Figure Stats*/
//DMType Which of the following best describes the role in which you interacted the most with parents? You will answer the remaining questions in this survey with that role in mind.
// 
gen DMType2=""
	replace DMType2=DMType
	replace DMType2="Family" if DMType=="Grandparent"	
	replace DMType2="Medical/Dental" if DMType=="Dentist"
	replace DMType2="Medical/Dental" if DMType=="Doctor"
	replace DMType2="Medical/Dental" if DMType=="Medical practitioner (other than Doctor or Nurse)"
	replace DMType2="Medical/Dental" if DMType=="Nurse"
	replace DMType2="Medical/Dental" if DMType=="Therapist"	
	replace DMType2="Extracurricular Leader (not sport)" if DMType=="Club leader (e.g. Scouts)"
	replace DMType2="Extracurricular Leader (not sport)" if DMType=="Leader: Academic/Tutoring"	
	replace DMType2="Extracurricular Leader (not sport)" if DMType=="Leader: Art/Dance"	
	replace DMType2="School Related" if DMType=="School Nurse"	
	replace DMType2="School Related" if DMType=="School administrator"
	replace DMType2="School Related" if DMType=="Teacher"
	replace DMType2="School Related" if DMType=="College Counselor"	
	replace DMType2="School Related" if DMType=="College Counselor"	
	replace DMType2="Religious Leader" if DMType=="Organized religion leader"
	replace DMType2="Sports Leader" if DMType=="Leader: Sport"
	//Those who self-reported "Other"
	//replace DMType2="Medical personnel" if DMType_19_TEXT=="patient access coordinator"
	//replace DMType2="Family" if DMType_19_TEXT=="great aunt"
	//replace DMType2="Family" if DMType_19_TEXT=="Aunt"
tabstat ContactMomFirst ContactMomFirstPct, by(DMType) 

//What proportion of the time do you contact the father/mother first if only contacting one parent first?
tabstat ContactMomFirstPct, by(DMType2) stat(mean N)
	//Asking about "father" vs. "mother" doesn't seem to have big effect
	tabstat ContactMomFirstPct if DadListedFirst=="1", by(DMType2)  stat(mean N)
	tabstat ContactMomFirstPct if DadListedFirst=="0", by(DMType2)  stat(mean N)
	
gen ContactDadFirstPct=1-ContactMomFirstPct	

save "$data/3_decision_makers/DM_survey_clean.dta", replace

//-------------------ANALYSIS
clear
cd "$data/3_decision_makers"
use DM_survey_clean.dta

graph bar (mean) ContactMomFirstPct (mean) ContactDadFirstPct if DMType2!="Other",  ///
	over(DMType2, label(angle(55)) sort(ContactMomFirstPct)) ///
	stack bar(1, fcolor(orange) lcolor(orange)) bar(2, fcolor(ltblue%70) lcolor(ltblue)) ///
	ytitle(Proportion) ylab (,nogrid) ///
	legend(order(1 "Call Mom 1st" 2 "Call Dad 1st") row(1)) ///
	bargap(30) yline(.5) yscale(range(0(.1)1))
	graph display, ysize(6) xsize(5.5)
cd "$figures"	
*graph export "ContactMomFirstPct.png", as(png) replace
	
bysort DMType: gen count_DMType=_N

//What proportion of the time do you contact both parents at the same time (e.g. by sending a group text or group email) out of the total number of times you contact parents in general?
destring ContactBothParentsPr_4, force replace 
tabstat ContactBothParentsPr_4, by(DMType)  stat(mean N)

//----------External Validity
//How common is it for parents to contact you via email?
tab ContactEmail
gen ContactEmailCommon=.
	replace ContactEmailCommon=0 if ContactEmail!=""
	replace ContactEmailCommon=1 if ContactEmail=="Somewhat Common: Happens about once a month"
	replace ContactEmailCommon=1 if ContactEmail=="Very Common: Happens at least once a week"
tabstat ContactEmailCommon, by(DMType)  stat(mean N)
	
//When you receive an email from parents, how common is it for the email to come from a joint family account (e.g. TheWiseFamily@gmail.com, TheSmiths@Smiths.com, TheLopezFamily@hotmail.com)?
tab JointEmail 

//How common is it for one parent to email you while also including or cc’ing their partner/spouse on the email?
tab CCSpouse

//How common is it for you to contact parents via email?
tab ContactParentsEmail

//How common is it for you to contact parents by calling on the phone?
tab ContactParentsPhone

//In what month(s)  do you interact with parents the most (select all that apply)? 
gen MonthEnrollmentQs_01_Jan= strpos(MonthQs_1, "Jan") >0
gen MonthEnrollmentQs_02_Feb=strpos(MonthQs_2, "Feb") >0
gen MonthEnrollmentQs_03_March=strpos(MonthQs_3, "March") >0
gen MonthEnrollmentQs_04_Apr=strpos(MonthQs_4, "Apr") >0
gen MonthEnrollmentQs_05_May=strpos(MonthQs_5, "May") >0
gen MonthEnrollmentQs_06_Jun=strpos(MonthQs_6, "Jun") >0
gen MonthEnrollmentQs_07_Jul=strpos(MonthQs_7, "Jul") >0
gen MonthEnrollmentQs_08_Aug=strpos(MonthQs_8, "Aug") >0
gen MonthEnrollmentQs_09_Sep=strpos(MonthQs_9, "Sep") >0
gen MonthEnrollmentQs_10_Oct=strpos(MonthQs_10, "Oct") >0
gen MonthEnrollmentQs_11_Nov=strpos(MonthQs_11, "Nov") >0
gen MonthEnrollmentQs_12_Dec=strpos(MonthQs_12, "Dec") >0

fsum MonthEnrollmentQs_*

//-------------------Have Children
gen TwoParentHetero=0
	replace TwoParentHetero=1 if HaveChildren=="Yes"&HouseholdType=="One mother and one father raising child(ren) in a shared household"
	
gen HH_MotherRespond=.
	replace HH_MotherRespond=0 if MotherVFather!=""
	replace HH_MotherRespond=1 if MotherVFather=="Mother"

//Think of the most recent thing you signed your child up for (e.g. school registration, summer camp, sports). Were you able to list 2+ contacts in the system?	
	//Did you have to denote who was the "primary contact"?
gen SignupPrimaryOption=.
	replace SignupPrimaryOption=0 if HH_Signup_Primary!=""
	replace SignupPrimaryOption=1 if HH_Signup_Primary=="Yes"
	
gen SignupPrimaryMom=0 if SignupPrimaryOption!=.
	replace SignupPrimaryMom=1 if HH_MotherRespond==1&HH_Signup_PrimaryWho=="Yourself"&HouseholdType=="One mother and one father raising child(ren) in a shared household"
	replace SignupPrimaryMom=1 if MotherVFather=="Father"&HH_Signup_PrimaryWho=="Spouse/Partner"&HouseholdType=="One mother and one father raising child(ren) in a shared household"

/* Mom is "Primary" 62% of time */
tabstat SignupPrimaryMom if TwoParentHetero==1, stat(mean N)

//HH_job_child_all: Think about the job(s) you held while your child/children were under age 12 (including being a stay-at-home parent). How much did child related interruptions affect your job/career moves you made during this time period?
tab HH_job_child_all if TwoParentHetero==1&MotherVFather=="Mother"
tab HH_job_child_all if TwoParentHetero==1&MotherVFather=="Father"

gen HH_job_ConsideChildStrongSome=.
	replace HH_job_ConsideChildStrongSome=1 if HH_job_child_all=="Strongly considered"
	replace HH_job_ConsideChildStrongSome=1 if HH_job_child_all=="Somewhat considered"
	replace HH_job_ConsideChildStrongSome=0 if HH_job_child_all=="Hardly considered"
	replace HH_job_ConsideChildStrongSome=0 if HH_job_child_all=="Did not consider"
	
ttest HH_job_ConsideChildStrongSome if TwoParentHetero==1&MotherVFather!="Other", by(MotherVFather)

//HH_job_child_org: Think about the job(s) you held while your child/children were under age 12 (including being a stay-at-home parent). How much did child related interruptions affect your original choice of your job/career
tab HH_job_child_org if TwoParentHetero==1&MotherVFather=="Mother"
tab HH_job_child_org if TwoParentHetero==1&MotherVFather=="Father"

gen HH_job_OrgJobChildStrongSome=.
	replace HH_job_OrgJobChildStrongSome=1 if HH_job_child_org=="Strongly considered"
	replace HH_job_OrgJobChildStrongSome=1 if HH_job_child_org=="Somewhat considered"
	replace HH_job_OrgJobChildStrongSome=0 if HH_job_child_org=="Hardly considered"
	replace HH_job_OrgJobChildStrongSome=0 if HH_job_child_org=="Did not consider"

ttest HH_job_OrgJobChildStrongSome if TwoParentHetero==1&MotherVFather!="Other", by(MotherVFather)	
	
//HH_Prop_ContactPartn: When you are the first and only person contacted by your child's school, what proportion of the time do you contact your partner to help resolve the school's inquiry? Mark NA if you are never the first and only person contacted by your child's school.
destring HH_Prop_ContactPartn, force replace
tabstat HH_Prop_ContactPartn, by(MotherVFather) stat(mean N)

//PropCont: What proportion of the time does the following organization/person contact you versus your partner? Mark NA if you do not interact with this type of organization/person.
//PropContWISH: What proportion of the time do you WISH the following organization/person contacted you versus your partner? Mark NA if you do not interact with this type of organization/person.
//PropYouCon: When the following organization/person contacts your family, what proportion of the time do you respond first? Mark NA if you do not interact with this type of organization/person.
//PropYouConWANT: When the following organization/person contacts your family, what proportion of the time do you WANT to be the first to respond? Mark NA if you do not interact with this type of organization/person.
	//Had to check Excel to figure this out

global ContactVars "PropCont_ PropContWISH_ PropYouCon_ PropYouConWANT_"
foreach ConVar in $ContactVars {	
	destring `ConVar'1 `ConVar'6 `ConVar'7 `ConVar'8 `ConVar'9 `ConVar'10 `ConVar'11 `ConVar'12, force replace
	
	rename `ConVar'1 HH_`ConVar'School
	rename `ConVar'6 HH_`ConVar'Doctor
	rename `ConVar'7 HH_`ConVar'LawEnf
	rename `ConVar'8 HH_`ConVar'Sports
	rename `ConVar'9 HH_`ConVar'OtherExtraCurr
	rename `ConVar'10 HH_`ConVar'Childcare
	rename `ConVar'11 HH_`ConVar'Relg
	rename `ConVar'12 HH_`ConVar'OtherAdults //Grandparents Family Friends
}

fsum HH_PropCont_* if TwoParentHetero==1
fsum HH_PropContWISH_* if TwoParentHetero==1
fsum HH_PropYouCon_* if TwoParentHetero==1
fsum HH_PropYouConWANT_* if TwoParentHetero==1

tabstat HH_PropCont_* if TwoParentHetero==1 , by(MotherVFather)
tabstat HH_PropContWISH_* if TwoParentHetero==1, by(MotherVFather)
tabstat HH_PropYouCon_* if TwoParentHetero==1, by(MotherVFather)
tabstat HH_PropYouConWANT_* if TwoParentHetero==1, by(MotherVFather)

graph bar (mean) HH_PropCont_* if TwoParentHetero==1, by(MotherVFather)
graph bar (mean) HH_PropContWISH_* if TwoParentHetero==1, by(MotherVFather)
graph bar (mean) HH_PropYouCon_* if TwoParentHetero==1, by(MotherVFather)
graph bar (mean) HH_PropYouConWANT_* if TwoParentHetero==1, by(MotherVFather)


global InstVars "School Doctor LawEnf Sports OtherExtraCurr Childcare Relg OtherAdults"
foreach var in $InstVars {	
gen HH_Cont_WishGap_`var'=HH_PropContWISH_`var' - HH_PropCont_`var'
}

fsum HH_Cont_WishGap_* if TwoParentHetero==1&MotherVFather=="Mother"
fsum HH_Cont_WishGap_* if TwoParentHetero==1&MotherVFather=="Father"

//---------Demographics
tab Age
tab Gender
//Ethnicity
tab Political
tab Education

//-----------GSS
//Do you approve or disapprove of a married woman earning money in business or industry if she has a husband capable of supporting her?
tab GSS_MarriedBusiness
//Do you agree or disagree with this statement? Women should take care of running their home and leave running the country up to men.
tab GSS_WomenRunHome
//If your party nominated a woman for president, would you vote for her if she were qualified for the job? 
tab GSS_WomanPresident
//Do you agree or disagree with this statement? Most men are better suited emotionally for politics than are most women.
tab GSS_EmotionPolt 
//Please answer whether you strongly agree, agree, disagree, or strongly disagree with the following statement: A working mother can establish just as warm and secure a relationship with her children as a mother who does not work.
tab GSS_WorkSecureRel
//Please answer whether you strongly agree, agree, disagree, or strongly disagree with the following statement: A preschool child is likely to suffer if his or her mother works.
tab GSS_ChildSuffer
//Please answer whether you strongly agree, agree, disagree, or strongly disagree with the following statement: It is more important for a wife to help her husband's career than to have one herself.
tab GSS_WifeHelpHusb
// Please answer whether you strongly agree, agree, disagree, or strongly disagree with the following statement: It is much better for everyone involved if the man is the achiever outside the home and the woman takes care of the home and family.
tab GSS_ManOutsideHome

//----------Systems
//When you interact with caregivers, do you have access to a system which gives you contact information for caregivers? 
	//Less than half have access to a system
tab SystemsScreen

//When you interact with parents, how often do you have access to information about only one contact person (if this is a household with two or more caregivers)?
	//Many have info about only 1 parent in the system
tab System_1contact

//Does the system you access with contact information for caregivers denote who is the “primary” contact?
tab Systems_PrimaryCont

//In households with a male and female parent both caring for the child, what proportion of the time is the female parent listed as the "primary" contact?
//OR
//In households with a male and female parent both caring for the child, what proportion of the time is the male parent listed as the "primary" contact?
// randomized by DadListedFirst
destring Syst_FemPrim_F1 Syst_MalPrim_M1, force replace
gen SystemMomFirstPrimPct=.
	replace SystemMomFirstPrimPct=Syst_FemPrim_F1 if Syst_FemPrim_F1!=.
	replace SystemMomFirstPrimPct=100-Syst_MalPrim_M1 if Syst_MalPrim_M1!=.
	replace SystemMomFirstPrimPct=SystemMomFirstPrimPct/100
sum SystemMomFirstPrimPct 
sum SignupPrimaryMom 

/* Only 2 of the DMs said there isn't a primary rest NA */
//In households with a male and female parent both caring for the child, what proportion of the time is the female parent listed as the first (if there is an ordering but no designation of which parent is the "primary" contact)?
//OR
//In households with a male and female parent both caring for the child, what proportion of the time is the male parent listed as the first (if there is an ordering but no designation of which parent is the "primary" contact)?
destring Syst_Fem1st_NotPr_F1 Syst_Mal1st_NotPr_M1, force replace
gen SystemMomFirstPct=.
	replace SystemMomFirstPct=Syst_Fem1st_NotPr_F1 if Syst_Fem1st_NotPr_F1!=.
	replace SystemMomFirstPct=100-Syst_Mal1st_NotPr_M1 if Syst_Mal1st_NotPr_M1!=.
	replace SystemMomFirstPct=SystemMomFirstPct/100
sum SystemMomFirstPct 

//Which parent contacts you most often?
tab ParentContactsYou
	
label define outcomel ///
	0 "No Call" ///
	1 "Female (Mom) Call" ///
	2 "Male (Dad) Call"

global genders "M F"

global treatments "Avail_Baseline_JM"


foreach treat in $treatments {
gen `treat'Call=.
foreach g in $genders {
	replace `treat'Call=1 if `treat'_`g'1=="Call Erica"|`treat'_`g'1=="Call Erica, then Roy"
	replace `treat'Call=2 if `treat'_`g'1=="Call Roy"|`treat'_`g'1=="Call Roy, then Erica"
	replace `treat'Call=0 if `treat'_`g'1=="Do not call either parent"
	}
label values `treat'Call outcomel	
	
gen `treat'CallMom=.	
foreach g in $genders {
	replace `treat'CallMom=1 if `treat'_`g'1=="Call Erica"|`treat'_`g'1=="Call Erica, then Roy"
	replace `treat'CallMom=0 if `treat'_`g'1=="Call Roy"|`treat'_`g'1=="Call Roy, then Erica"
	}
}

tab Avail_Baseline_JMCall
tab Avail_Baseline_JMCallMom
tabstat Avail_Baseline_JMCallMom ContactMomFirstPct, by(DMType2) stat(mean)
